package com.mach.platform.repository;

import com.mach.platform.domain.ProductionOrderTerm;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductionOrderTermRepo extends BaseRepository<ProductionOrderTerm> {

    @Modifying
    @Query(value = "delete from production_order_term where production_order_id = ?1", nativeQuery = true)
    void deleteByProductionOrderId(Long id);

    List<ProductionOrderTerm> findAllByProductionOrderIdIn(List<Long> productionOrderIds);
}
